﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Module_RibbonBar_Bar_Default : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Genesis.Client.Module.Classes.ModuleProvider moduleProvider = new Genesis.Client.Module.Classes.ModuleProvider();

            System.Data.DataTable ribbonBarTable = moduleProvider.RibbonBarGetList();

            System.Data.DataColumn editUrlColumn = new System.Data.DataColumn("EditUrl", typeof(string));
            //System.Data.DataColumn deleteUrlColumn = new System.Data.DataColumn("DeleteUrl", typeof(string));

            ribbonBarTable.Columns.Add(editUrlColumn);
            //ribbonBarTable.Columns.Add(deleteUrlColumn);

            foreach (System.Data.DataRow row in ribbonBarTable.Rows)
            {
                row["EditUrl"] = string.Format("<a href=\"Detail.aspx?RibbonBarGuid={0}&FormMode=Edit\">{1}</a>",
                    row["RibbonBarGuid"],
                    row["RibbonBarId"]);
                //row["DeleteUrl"] = string.Format("<a href=\"Detail.aspx?RibbonBarGuid={0}&FormMode=Delete\"><img alt=\"Delete\" src=\"/Genesis.Management.Web/Images/trash.ico\" /></a>",
                //    row["RibbonBarGuid"]);
            }

            GridView1.DataSource = ribbonBarTable;
            GridView1.DataBind();
        }
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        Response.Redirect(this.buildForwardUrl("Detail.aspx?FormMode=Create"));
    }
}
